Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
babel-plugin-polyfill-corejs2
Advanced tools
A Babel plugin to inject imports to core-js@2 polyfills
The babel-plugin-polyfill-corejs2 package is designed to automatically replace ES2015+ code with equivalent down-leveled code that includes polyfills from the core-js library version 2. This allows developers to write modern JavaScript without worrying about the support in older environments. It's particularly useful for ensuring that new JavaScript features work across all browsers that a web application supports.
Automatic Polyfilling
Automatically detects the usage of ES2015+ features in your code and includes the necessary polyfills from core-js v2. This means you don't have to manually import or require polyfills in your code, reducing the bundle size and improving performance.
"useBuiltIns": "usage"
Configurable Environment
Allows you to specify the target environments for your application. Babel will use this information to determine which polyfills are necessary based on the features supported by those environments, ensuring that your code runs smoothly across different browsers.
{
"targets": {
"chrome": "58",
"ie": "11"
}
}
Similar to babel-plugin-polyfill-corejs2, but it relies on core-js version 3 for polyfills. core-js v3 offers more features and polyfills for newer ECMAScript specifications, making it a better choice for projects that need the latest JavaScript features.
A Babel preset that allows you to specify an environment and automatically enables the necessary plugins and polyfills based on the targeted browsers or runtime environments. While not a direct replacement, it offers similar functionality by including necessary polyfills through the use of core-js.
Using npm:
npm install --save-dev babel-plugin-polyfill-corejs2
or using yarn:
yarn add babel-plugin-polyfill-corejs2 --dev
Add this plugin to your Babel configuration:
{
"plugins": [["polyfill-corejs2", { "method": "usage-global" }]]
}
This package supports the usage-pure
, usage-global
, and entry-global
methods.
When entry-global
is used, it replaces imports to core-js
.
FAQs
A Babel plugin to inject imports to core-js@2 polyfills
The npm package babel-plugin-polyfill-corejs2 receives a total of 22,737,945 weekly downloads. As such, babel-plugin-polyfill-corejs2 popularity was classified as popular.
We found that babel-plugin-polyfill-corejs2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.